#include "isBalanced.h"
bool isHeight(TreeNode* root) {
  if (!root) return true;
  return abs(maxDepth(root->left) - maxDepth(root->right)) <= 1;
}
bool isBalanced(TreeNode* root) {
  if (!root)
    return true;
  else
    return abs(maxDepth(root->left) - maxDepth(root->right)) <= 1 &&
           isBalanced(root->left) && isBalanced(root->right);
}